<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/system">系统管理</a></li>
          <li class="active">客服二维码</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>客服二维码&nbsp;-&nbsp;二维码列表</span></h2>
            </div>
          </div>
          
          <div class="x-breadcrumb-wrapper top-margin-20" style="position: relative;">
          
            <ul class="nav nav-tabs x-breadcrumb-nav">
            
              <c:forEach var="qrcodeType" items="${enums['QrcodeType']}" varStatus="index">
              
                <c:if test="${serviceQrcodeMappings[qrcodeType.name].size() > 0}">
                  <li class="${index.first ? 'pull-left active' : 'pull-left'}"><a href="#${qrcodeType}" role="tab" data-toggle="tab">${qrcodeType.description}</a></li>
                </c:if>
                
              </c:forEach>
              
              <a href="${ctx.host}/qrcodes/create" data-target="#create-qrcode" data-toggle="modal" title="添加二维码" class="btn btn-default x-btn btn-shadow btn-shadow-default pull-right" >
                <i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加二维码
              </a>
              
            </ul>
            
          </div>
          
          <div class="tab-content">
          
            <c:if test="${not empty serviceQrcodeMappings['ON_LINE']}">
              <div role="tabpanel" class="tab-pane active" id="ON_LINE">
                
                <div class="x-cards row"  style="margin-top: 20px;">
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['ON_LINE']}" step="3" begin="0">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/delete" data-toggle="modal" data-target="#delete-qrcode" data-placement="left" title="删除二维码"><i class="glyphicon glyphicon-remove"></i></a>
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                  
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['ON_LINE']}" step="3" begin="1">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/delete" data-toggle="modal" data-target="#delete-qrcode" data-placement="left" title="删除二维码"><i class="glyphicon glyphicon-remove"></i></a>
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                  
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['ON_LINE']}" step="3" begin="2">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/delete" data-toggle="modal" data-target="#delete-qrcode" data-placement="left" title="删除二维码"><i class="glyphicon glyphicon-remove"></i></a>
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                </div>
                
              </div>
            </c:if>
            
            <c:if test="${not empty serviceQrcodeMappings['OFF_LINE']}">
              <div role="tabpanel" class="tab-pane" id="OFF_LINE">
                
                <div class="x-cards row"  style="margin-top: 20px;">
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['OFF_LINE']}" step="3" begin="0">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                  
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['OFF_LINE']}" step="3" begin="1">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                  
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['OFF_LINE']}" step="3" begin="2">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                </div>
                
              </div>
            </c:if>
            
            <c:if test="${not empty serviceQrcodeMappings['GROUP_BLOCK']}">
              <div role="tabpanel" class="tab-pane" id="GROUP_BLOCK">
                <div class="x-cards row"  style="margin-top: 20px;">
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['GROUP_BLOCK']}" step="3" begin="0">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                  
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['GROUP_BLOCK']}" step="3" begin="1">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                  
                  <div class="card col-xs-4" style="padding: 0px;">
                    <c:forEach var="qrcode" items="${serviceQrcodeMappings['GROUP_BLOCK']}" step="3" begin="2">
                      <div class="col-xs-12 card">
                        <div class="panel panel-default denver-panel denver-panel-layout">
                          <div class="panel-body" style="padding: 0px;">
                            <div class="panel-img-wrapper" style="height: auto;">
                              <img alt="" src="${cloud.prod}/${qrcode.value}-qrcode">
                            </div>
                            <div class="product-operation clearfix" style="border-top: 1px solid #ccc;">
                              <p style="padding: 10px; margin: 0px;">${qrcode.name}</p>
                            </div>
                          </div>
                          <div class="panel-footer clearfix">
                            <a class="btn btn-default" href="${ctx.host}/qrcodes/${qrcode.id}/edit" data-toggle="modal" data-target="#edit-qrcode" data-placement="left" title="重新上传"><i class="glyphicon glyphicon-edit"></i></a>
                          </div>
                        </div>
                      </div>
                    </c:forEach>
                  </div>
                </div>
              </div>
            </c:if>
          </div>
          
        </div>

      </div>
    </div>
  
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/system/qrcode/qrcode-list.js">
    <script type="text/javascript">
      require(['page/system/qrcode/qrcode-list'] , function(page){
    	  page.init();
      })
    </script>
  </d:resource>
  
</body>

</html>